home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0828.ZIP / DEXPERT.ZIP / TRAINING.PRG < prev   
Text File  |  1987-02-06  |  9KB  |  366 lines

  1.  
  2. * System....: Training
  3. * Procedure File..:TRAINING.prg
  4. * Author........:Brian Corll
  5. * Date:.......02/04/87
  6. * Notice......Copyright 1987, the Author
  7.  
  8.  
  9.  
  10. Procedure Creator
  11.  
  12. clear
  13. set stat off
  14. set scor off
  15. set safe off
  16. set talk off
  17. set conf on
  18. set colo to bg+/n,w/g
  19. filename=space(8)
  20. @ 1,0 say "This program allows you to create help screens"
  21. @ 2,0 say "for training purposes. First, you need to choose"
  22. @ 3,0 say "a name for your screen file. It can be no more"
  23. @ 4,0 say "than eight letters long."
  24. @ 5,0 say "Enter the name here:" get filename picture "!!!!!!!!"
  25. read
  26. screenfile=trim(filename)
  27. use screens.trf
  28. copy stru to &screenfile..trf
  29. clos data
  30. bc=.t.
  31. do while bc
  32.     clear
  33.     set colo to bg+/n,w/g
  34.     use &screenfile..trf alias aa
  35.     yesno=space(1)
  36.     @ 1,0 say "Make a new screen? (Y or N)" get yesno pict "!"
  37.     read
  38.     if yesno="N"
  39.         clos data
  40.         exit
  41.     else
  42.     endif
  43.     @ 1,0 clear
  44.     appe blank
  45.     set colo to gr+/n
  46.     @ 24,0 say "Screen Number "+ltrim(str(recno()))
  47.     set colo to b+/n
  48.     @ 20,22 say "Enter Screen Text in the box above."
  49.     set colo to bg+/n,w/g
  50.     @  0,  0  SAY "1"
  51.     @  0,  2  GET  aa->LINE1
  52.     @  1,  0  SAY "2"
  53.     @  1,  2  GET  aa->LINE2
  54.     @  2,  0  SAY "3"
  55.     @  2,  2  GET  aa->LINE3
  56.     @  3,  0  SAY "4"
  57.     @  3,  2  GET  aa->LINE4
  58.     @  4,  0  SAY "5"
  59.     @  4,  2  GET  aa->LINE5
  60.     @  5,  0  SAY "6"
  61.     @  5,  2  GET  aa->LINE6
  62.     @  6,  0  SAY "7"
  63.     @  6,  2  GET  aa->LINE7
  64.     @  7,  0  SAY "8"
  65.     @  7,  2  GET  aa->LINE8
  66.     @  8,  0  SAY "9"
  67.     @  8,  2  GET  aa->LINE9
  68.     @  9,  0  SAY "10"
  69.     @  9,  2  GET  aa->LINE10
  70.     @ 10,  0  SAY "11"
  71.     @ 10,  2  GET  aa->LINE11
  72.     @ 11,  0  SAY "12"
  73.     @ 11,  2  GET  aa->LINE12
  74.     @ 12,  0  SAY "13"
  75.     @ 12,  2  GET  aa->LINE13
  76.     @ 13,  0  SAY "14"
  77.     @ 13,  2  GET  aa->LINE14
  78.     @ 14,  0  SAY "15"
  79.     @ 14,  2  GET  aa->LINE15
  80.     @ 15,  0  SAY "16"
  81.     @ 15,  2  GET  aa->LINE16
  82.     @ 16,  0  SAY "17"
  83.     @ 16,  2  GET  aa->LINE17
  84.     @ 17,  0  SAY "18"
  85.     @ 17,  2  GET  aa->LINE18
  86.     read
  87.     clear
  88.     set colo to gr+/n
  89.     @ 24,0 say "Screen Number "+ltrim(str(recno()))
  90.     set colo to bg+/n,w/g
  91.     @  1,  0  SAY "P1"
  92.     @  1,  3  GET  aa->PROMPT1
  93.     @  2,  0  SAY "P2"
  94.     @  2,  3  GET  aa->PROMPT2
  95.     @  3,  0  SAY "P3"
  96.     @  3,  3  GET  aa->PROMPT3
  97.     @  4,  0  SAY "P4"
  98.     @  4,  3  GET  aa->PROMPT4
  99.     @  6,  0  SAY "If Response is:->"
  100.     @  6, 17  GET  aa->RESPONSE1
  101.     @  6, 20  SAY "-> Go to Screen Number:"
  102.     @  6, 44  GET  aa->LINKER1
  103.     @  7,  2  SAY "If Response is:->"
  104.     @  7, 19  GET  aa->RESPONSE2
  105.     @  7, 22  SAY "---->Go to Screen Number:"
  106.     @  7, 48  GET  aa->LINKER2
  107.     @  8,  4  SAY "If Response is->"
  108.     @  8, 20  GET  aa->RESPONSE3
  109.     @  8, 23  SAY "-------> Go to Screen Number:"
  110.     @  8, 53  GET  aa->LINKER3
  111.     @  9,  6  SAY "If Response is->"
  112.     @  9, 22  GET  aa->RESPONSE4
  113.     @  9, 25  SAY "---------->Go to Screen Number:"
  114.     @  9, 57  GET  aa->LINKER4
  115.     @ 10,  8  SAY "If Response is->"
  116.     @ 10, 24  GET  aa->RESPONSE5
  117.     @ 10, 27  SAY "-----------> Go to Screen Number:"
  118.     @ 10, 61  GET  aa->LINKER5
  119.     @ 11, 10  SAY "If Response is->"
  120.     @ 11, 26  GET  aa->RESPONSE6
  121.     @ 11, 29  SAY "------------->Go to Screen Number:"
  122.     @ 11, 64  GET  aa->LINKER6
  123.     @ 12, 12  SAY "If Response is->"
  124.     @ 12, 28  GET  aa->RESPONSE7
  125.     @ 12, 31  SAY "--------------> Go to screen Number:"
  126.     @ 12, 68  GET  aa->LINKER7
  127.     @ 13, 14  SAY "If Response is->"
  128.     @ 13, 30  GET  aa->RESPONSE8
  129.     @ 13, 33  SAY "----------------> Go to Screen Number:"
  130.     @ 13, 72  GET  aa->LINKER8
  131.     @ 14, 16  SAY "If Response is->"
  132.     @ 14, 32  GET  aa->RESPONSE9
  133.     @ 14, 35  SAY "------------------> Go to Screen Number:"
  134.     @ 14, 76  GET  aa->LINKER9
  135.     @ 15, 18  SAY "If Response is->"
  136.     @ 15, 34  GET  aa->RESPONSE10
  137.     @ 15, 37  SAY "------------->Go to Screen Number:"
  138.     @ 15, 72  GET  aa->LINKER10
  139.     @ 17,10 say "Code for Text Color:" get aa->TOPCOLOR
  140.     @ 19,10 say "Code for Prompt Color:" get aa->BELOWCOLOR
  141.    read
  142. store recno() to fetchit
  143. clos data
  144. clear
  145. yesno=space(1)
  146. @ 1,0 say "Would you like to preview the screen ? (Y or N)";
  147.  get yesno picture "!"
  148.     read
  149. clear
  150. if yesno="Y"
  151.     do while yesno="Y"
  152.     clear
  153.     use &screenfile..trf alias aa
  154.     go fetchit
  155.     tc=topcolor
  156.     bl=belowcolor
  157.     set colo to &tc/n
  158.     @  0,  1  say  aa->LINE1
  159.     @  1,  1  say  aa->LINE2
  160.     @  2,  1  say  aa->LINE3
  161.     @  3,  1  say  aa->LINE4
  162.     @  4,  1  say  aa->LINE5
  163.     @  5,  1  say  aa->LINE6
  164.     @  6,  1  say  aa->LINE7
  165.     @  7,  1  say  aa->LINE8
  166.     @  8,  1  say  aa->LINE9
  167.     @  9,  1  say  aa->LINE10
  168.     @ 10,  1  say  aa->LINE11
  169.     @ 11,  1  say  aa->LINE12
  170.     @ 12,  1  say  aa->LINE13
  171.     @ 13,  1  say  aa->LINE14
  172.     @ 14,  1  say  aa->LINE15
  173.     @ 15,  1  say  aa->LINE16
  174.     @ 16,  1  say  aa->LINE17
  175.     @ 17,  1  say  aa->LINE18
  176.     set colo to &bl/n
  177.     @ 18, 5  say  aa->PROMPT1
  178.     @ 19, 5  say  aa->PROMPT2
  179.     @ 20, 5  say  aa->PROMPT3
  180.     @ 21, 5  say  aa->PROMPT4
  181.     yesno="N"
  182.     @ 22,5 say "Would you like to edit the screen?" get yesno;
  183.  picture "!"
  184.     read
  185.     if yesno="Y"
  186.     clear
  187.     set colo to bg+/n,w/g
  188.     set form to screens
  189.     edit
  190.     set form to prompts
  191.     edit
  192.     loop
  193.     clos data
  194.     else
  195.     exit
  196.     endif
  197.     enddo
  198. else
  199. clos data
  200. endif
  201. enddo
  202. return
  203.  
  204. Procedure Editor
  205.  
  206. clear
  207. set talk off
  208. set esca on
  209. set conf on
  210. set stat off
  211. set scor off
  212. set colo to bg+/n,w/g
  213. @ 1,0 say "The following training files are available for editing:"
  214. dir *.trf
  215. filename=space(8)
  216. @ 24,0 say "Enter the name of the file to edit:" get filename;
  217.  picture "!!!!!!!!"
  218. read
  219. if .not. file('&filename..trf')
  220.     do while .not. file('&filename..trf')
  221.     @ 24,0 clear
  222.     filename=space(8)
  223.     ? chr(7)
  224.     @ 24,0 say "INVALID ENTRY! Try again:" get filename;
  225.  picture "!!!!!!!!"
  226.     read
  227.     enddo
  228. else
  229. endif
  230. findname=trim(filename)
  231. do while .not. eof()
  232. clear
  233. use &findname..trf alias aa
  234. if reccount()=0
  235. return
  236. else
  237. endif
  238. gonum=0
  239. @ 2,0 say "Which screen do you want to edit?" get gonum;
  240.  picture "@Z 9999"
  241. @ 3,0 say "(Enter a zero to return to the menu.)"
  242. read
  243. if gonum=0
  244. exit
  245. else
  246. endif
  247. go gonum
  248. set form to screens
  249. edit
  250. set form to prompts
  251. edit
  252. clos data
  253. enddo
  254. clos all
  255. return
  256.  
  257.  
  258.  
  259. Procedure Trainer
  260.  
  261. clear
  262. set esca off
  263. set stat off
  264. set scor off
  265. set safe off
  266. set talk off
  267. set echo off
  268. set colo to bg+/n,w/g
  269. @ 1,0 say "The following training files are available for view:"
  270. dir *.trf
  271. FILENAME=SPACE(8)
  272. @ 24,0 SAY "Enter the name of the training file you want to view:";
  273.  get filename picture "!!!!!!!!"
  274. read
  275. filename=trim(filename)
  276. if .not. file('&filename..trf')
  277.    do while .not. file('&filename..trf')
  278.    ? chr(7)
  279.    @ 24,0 clear
  280.    filename=space(8)
  281.    @ 24,0 say "INVALID NAME! Try again:" get filename picture "!!!!!!!!"
  282.    read
  283.    if file('&filename..trf')
  284.    exit
  285.    else
  286.    endif
  287.    enddo
  288. else
  289. endif
  290. screenfile=trim(filename)
  291. use &screenfile..trf alias aa
  292. if reccount()=0
  293. return
  294. else
  295. endif
  296. go top
  297. do while .not. eof()
  298.     tc=topcolor
  299.     bl=belowcolor
  300.     set colo to &tc/n,w/g
  301.     clear
  302.     response=space(2)
  303.     @  0,  1  say  aa->LINE1
  304.     @  1,  1  say  aa->LINE2
  305.     @  2,  1  say  aa->LINE3
  306.     @  3,  1  say  aa->LINE4
  307.     @  4,  1  say  aa->LINE5
  308.     @  5,  1  say  aa->LINE6
  309.     @  6,  1  say  aa->LINE7
  310.     @  7,  1  say  aa->LINE8
  311.     @  8,  1  say  aa->LINE9
  312.     @  9,  1  say  aa->LINE10
  313.     @ 10,  1  say  aa->LINE11
  314.     @ 11,  1  say  aa->LINE12
  315.     @ 12,  1  say  aa->LINE13
  316.     @ 13,  1  say  aa->LINE14
  317.     @ 14,  1  say  aa->LINE15
  318.     @ 15,  1  say  aa->LINE16
  319.     @ 16,  1  say  aa->LINE17
  320.     @ 17,  1  say  aa->LINE18
  321.     set colo to &bl/n
  322.     @ 18, 5  say  aa->PROMPT1
  323.     @ 19, 5  say  aa->PROMPT2
  324.     @ 20, 5  say  aa->PROMPT3
  325.     @ 21, 5  say  aa->PROMPT4
  326.     @ 22, 12 say "Enter response here>>>>" get response pict "!!"
  327.     @ 23,12 say "Enter a Q to quit."
  328.     read
  329.     do case
  330.         case val(response)>10
  331.         ? chr(7),chr(7)
  332.         loop
  333.         case response="1" .and. linker1<>"    "
  334.         getit = val(linker1)
  335.         case response="2" .and. linker2<>"    "
  336.         getit=val(linker2)
  337.         case response="3" .and. linker3<>"    "
  338.         getit=val(linker3)
  339.         case response="4" .and. linker4<>"    "
  340.         getit=val(linker4)
  341.         case response="5" .and. linker5<>"    "
  342.         getit=val(linker5)
  343.         case response="6" .and. linker6<>"    "
  344.         getit=val(linker6)
  345.         case response="7" .and. linker7<>"    "
  346.         getit=val(linker7)
  347.         case response="8" .and. linker8<>"    "
  348.         getit=val(linker8)
  349.         case response="9" .and. linker9<>"    "
  350.         getit=val(linker9)
  351.         case response="10" .and. linker10<>"    "
  352.         getit=val(linker10)
  353.         case response="Q"
  354.         exit
  355.         otherwise
  356.         ? chr(7)
  357.         response=space(2)
  358.         getit=0
  359.         loop
  360.    endcase
  361. go getit
  362. enddo
  363. clos all
  364. return
  365.  
  366.